'use strict';
const { Service } = require('egg');
class ArticleService extends Service {
  async add() {
    const { ctx } = this;
    // 获取请求参数
    const {
      userId, title, content,
    } = ctx.params;
    // const result = await ctx
    console.log(userId, title, content);
    const result = await this.service.article.create({ userId, title, content });
    return result;
    // return null;
  }
  async create(userId, title, content) {
    // const { ctx } = this;
    const sqlObj = { userId, title, content };
    return sqlObj;
  }
}

module.exports = ArticleService;
